package com.dhkj.web.idf.model;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;



import java.util.ArrayList;
import java.util.List;

public class MenuPicture implements Parcelable,Cloneable{

    //绑定的菜单主键
    private String bindMenuPK;

    //菜单编号
    private String menuId;

    //菜单名称
    private String menuName;

    //菜单主键
    private int menuPK;

    //菜单图片
    private List<String> menuPicture;

    //菜单图片类型（1：菜单 2：餐盘 3：餐盘负样本）
    private int menuPictureType;

    //菜单简码
    private String menuSpell;

    //菜单类型主键
    private int menuTypePK;

    //消费类型主键 早中晚
    private int consumptionTypePK;

    private int menuCirculation;

    private int merchantMenuPK;

    //状态（1：启用 2：禁用 3：删除）
    private int state;

    //热量（克）
    private float calorie;

    //碳水化合物（克）
    private float carbohydrate;

    //脂肪（克）
    private float fat;

    //纤维素（克）
    private float fibre;

    //蛋白质（克）
    private float protein;

    //钠（毫克）
    private float sodium;

    private String comment;

    //
    private String stateValue;

    private int menuCost;

    private int nutritionMode;

    private List<MenuPrice> menuPrices;

    private List<PictureSize> pictureSizes;

    private String menuTypeId;

    private String menuTypeName;

    private String merchantName;

    private int merchantPK;

    private DishInfo dishInfo;

    @Override
    public String toString() {
        return "MenuPicture{" +
                "bindMenuPK='" + bindMenuPK + '\'' +
                ", menuId='" + menuId + '\'' +
                ", menuName='" + menuName + '\'' +
                ", menuPK=" + menuPK +
                ", menuPicture=" + menuPicture +
                ", menuPictureType=" + menuPictureType +
                ", menuSpell='" + menuSpell + '\'' +
                ", menuTypePK=" + menuTypePK +
                ", consumptionTypePK=" + consumptionTypePK +
                ", menuCirculation=" + menuCirculation +
                ", merchantMenuPK=" + merchantMenuPK +
                ", state=" + state +
                ", calorie=" + calorie +
                ", carbohydrate=" + carbohydrate +
                ", fat=" + fat +
                ", fibre=" + fibre +
                ", protein=" + protein +
                ", sodium=" + sodium +
                ", comment='" + comment + '\'' +
                ", stateValue='" + stateValue + '\'' +
                ", menuCost=" + menuCost +
                ", nutritionMode=" + nutritionMode +
                ", menuPrices=" + menuPrices +
                ", menuTypeId='" + menuTypeId + '\'' +
                ", menuTypeName='" + menuTypeName + '\'' +
                ", merchantName='" + merchantName + '\'' +
                ", merchantPK=" + merchantPK +
                '}';
    }

    @NonNull
    @Override
    protected Object clone(){
        try {
            return super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }

    public MenuPicture() {
    }

    public MenuPicture(Product product) {
        this.bindMenuPK = product.getBindMenuPK();
        this.menuId = product.getMenuId();
        this.menuName = product.getMenuName();
        this.menuPK = product.getMenuPK();
        this.menuPicture = product.getMenuPicture();
        this.menuPictureType = product.getMenuPictureType();
        this.menuSpell = product.getMenuSpell();
        this.menuTypePK = product.getMenuTypePK();
        this.state = product.getState();
        this.calorie = product.getCalorie();
        this.carbohydrate = product.getCarbohydrate();
        this.fat = product.getFat();
        this.fibre = product.getFibre();
        this.protein = product.getProtein();
        this.sodium = product.getSodium();
        this.comment = product.getComment();
        this.stateValue = product.getStateValue();
        this.menuCost = product.getMenuCost();
        this.nutritionMode = product.getNutritionMode();

        this.menuPrices = new ArrayList<>();


        this.menuPicture = new ArrayList<>();
        if (product.getMenuPicture() != null) {
            for (String picture : product.getMenuPicture()) {
                this.menuPicture.add(picture);
            }
        }
        this.menuTypeId = product.getMenuTypeId();
        this.menuTypeName = product.getMenuTypeName();
        this.merchantName = product.getMerchantName();
        this.merchantPK = product.getMerchantPK();
     }


    public String getBindMenuPK() {
        return bindMenuPK;
    }

    public void setBindMenuPK(String bindMenuPK) {
        this.bindMenuPK = bindMenuPK;
    }

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public int getMenuPK() {
        return menuPK;
    }

    public void setMenuPK(int menuPK) {
        this.menuPK = menuPK;
    }

    public List<String> getMenuPicture() {
        return menuPicture;
    }

    public void setMenuPicture(List<String> menuPicture) {
        this.menuPicture = menuPicture;
    }

    public int getMenuPictureType() {
        return menuPictureType;
    }

    public void setMenuPictureType(int menuPictureType) {
        this.menuPictureType = menuPictureType;
    }

    public String getMenuSpell() {
        return menuSpell;
    }

    public void setMenuSpell(String menuSpell) {
        this.menuSpell = menuSpell;
    }

    public int getMenuTypePK() {
        return menuTypePK;
    }

    public void setMenuTypePK(int menuTypePK) {
        this.menuTypePK = menuTypePK;
    }

    public int getConsumptionTypePK() {
        return consumptionTypePK;
    }

    public void setConsumptionTypePK(int consumptionTypePK) {
        this.consumptionTypePK = consumptionTypePK;
    }

    public int getMenuCirculation() {
        return menuCirculation;
    }

    public void setMenuCirculation(int menuCirculation) {
        this.menuCirculation = menuCirculation;
    }

    public int getMerchantMenuPK() {
        return merchantMenuPK;
    }

    public void setMerchantMenuPK(int merchantMenuPK) {
        this.merchantMenuPK = merchantMenuPK;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public float getCalorie() {
        return calorie;
    }

    public void setCalorie(float calorie) {
        this.calorie = calorie;
    }

    public float getCarbohydrate() {
        return carbohydrate;
    }

    public void setCarbohydrate(float carbohydrate) {
        this.carbohydrate = carbohydrate;
    }

    public float getFat() {
        return fat;
    }

    public void setFat(float fat) {
        this.fat = fat;
    }

    public float getFibre() {
        return fibre;
    }

    public void setFibre(float fibre) {
        this.fibre = fibre;
    }

    public float getProtein() {
        return protein;
    }

    public void setProtein(float protein) {
        this.protein = protein;
    }

    public float getSodium() {
        return sodium;
    }

    public void setSodium(float sodium) {
        this.sodium = sodium;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getStateValue() {
        return stateValue;
    }

    public void setStateValue(String stateValue) {
        this.stateValue = stateValue;
    }

    public int getMenuCost() {
        return menuCost;
    }

    public void setMenuCost(int menuCost) {
        this.menuCost = menuCost;
    }

    public int getNutritionMode() {
        return nutritionMode;
    }

    public void setNutritionMode(int nutritionMode) {
        this.nutritionMode = nutritionMode;
    }

    public List<MenuPrice> getMenuPrices() {
        return menuPrices;
    }

    public void setMenuPrices(List<MenuPrice> menuPrices) {
        this.menuPrices = menuPrices;
    }

    public String getMenuTypeId() {
        return menuTypeId;
    }

    public void setMenuTypeId(String menuTypeId) {
        this.menuTypeId = menuTypeId;
    }

    public String getMenuTypeName() {
        return menuTypeName;
    }

    public void setMenuTypeName(String menuTypeName) {
        this.menuTypeName = menuTypeName;
    }

    public String getMerchantName() {
        return merchantName;
    }

    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }

    public int getMerchantPK() {
        return merchantPK;
    }

    public void setMerchantPK(int merchantPK) {
        this.merchantPK = merchantPK;
    }

    public List<PictureSize> getPictureSizes() {
        return pictureSizes;
    }

    public void setPictureSizes(List<PictureSize> pictureSizes) {
        this.pictureSizes = pictureSizes;
    }

    public DishInfo getDishInfo() {
        return dishInfo;
    }

    public void setDishInfo(DishInfo dishInfo) {
        this.dishInfo = dishInfo;
    }

    public MenuPicture(Parcel in) {
        this.bindMenuPK = in.readString();
        this.menuId = in.readString();
        this.menuName = in.readString();
        this.menuPK = in.readInt();
        this.menuPicture = in.readArrayList(String.class.getClassLoader());
        this.menuPictureType = in.readInt();
        this.menuSpell = in.readString();
        this.menuTypePK = in.readInt();
        this.consumptionTypePK = in.readInt();
        this.menuCirculation = in.readInt();
        this.merchantMenuPK = in.readInt();
        this.state = in.readInt();
        this.calorie = in.readFloat();
        this.carbohydrate = in.readFloat();
        this.fat = in.readFloat();
        this.fibre = in.readFloat();
        this.protein = in.readFloat();
        this.sodium = in.readFloat();
        this.comment = in.readString();
        this.stateValue = in.readString();
        this.menuCost = in.readInt();
        this.nutritionMode = in.readInt();
        this.menuPrices = in.readArrayList(MenuPrice.class.getClassLoader());
        this.menuTypeId = in.readString();
        this.menuTypeName = in.readString();
        this.merchantName = in.readString();
        this.merchantPK = in.readInt();
        this.pictureSizes = in.readArrayList((PictureSize.class.getClassLoader()));
        this.dishInfo = in.readParcelable(DishInfo.class.getClassLoader());
    }

    public static final Parcelable.Creator<MenuPicture> CREATOR = new Parcelable.Creator<MenuPicture>() {
        @Override
        public MenuPicture createFromParcel(Parcel in) {
            return new MenuPicture(in);
        }

        @Override
        public MenuPicture[] newArray(int size) {
            return new MenuPicture[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(this.bindMenuPK);
        parcel.writeString(this.menuId);
        parcel.writeString(this.menuName);
        parcel.writeInt(this.menuPK);
        parcel.writeList(this.menuPicture);
        parcel.writeInt(this.menuPictureType);
        parcel.writeString(this.menuSpell);
        parcel.writeInt(this.menuTypePK);
        parcel.writeInt(this.consumptionTypePK);
        parcel.writeInt(this.menuCirculation);
        parcel.writeInt(this.merchantMenuPK);
        parcel.writeInt(this.state);
        parcel.writeFloat(this.calorie);
        parcel.writeFloat(this.carbohydrate);
        parcel.writeFloat(this.fat);
        parcel.writeFloat(this.fibre);
        parcel.writeFloat(this.protein);
        parcel.writeFloat(this.sodium);
        parcel.writeString(this.comment);
        parcel.writeString(this.stateValue);
        parcel.writeInt(this.menuCost);
        parcel.writeInt(this.nutritionMode);
        parcel.writeList(this.menuPrices);
        parcel.writeString(this.menuTypeId);
        parcel.writeString(this.menuTypeName);
        parcel.writeString(this.merchantName);
        parcel.writeInt(this.merchantPK);
        parcel.writeList(this.pictureSizes);
        parcel.writeParcelable(this.dishInfo,0);
    }
}
